<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_kv.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_37b66dfbfdffce01c33ebea49c49c2c3.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_kv.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__kv_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_KV_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_KV_H__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#if _KV_ENABLE</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structb_k_v___index__t.html">   56</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;{</div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structb_k_v___index__t.html#abaabdc509cdaba7df9f56c6c76f3ae19">   58</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___index__t.html#abaabdc509cdaba7df9f56c6c76f3ae19">id</a>;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structb_k_v___index__t.html#ac0d31ca829f934cccd89f8054e02773e">   59</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___index__t.html#ac0d31ca829f934cccd89f8054e02773e">address</a>;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structb_k_v___index__t.html#a96bbf959016e4411c9e6b9812a8be60a">   60</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___index__t.html#a96bbf959016e4411c9e6b9812a8be60a">len</a>;</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;}<a class="code" href="structb_k_v___index__t.html">bKV_Index_t</a>;    </div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160; </div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160; </div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html">   65</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#ade818037fd6c985038ff29656089758d">   67</a></span>&#160;    uint8_t <a class="code" href="structb_k_v___info__t.html#ade818037fd6c985038ff29656089758d">status</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#aae5a12e607d0f782506d9e6ec6179c64">   68</a></span>&#160;    uint8_t <a class="code" href="structb_k_v___info__t.html#aae5a12e607d0f782506d9e6ec6179c64">index</a>;</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#a104253e95536fa1af5f3d112f34b4088">   69</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structb_k_v___info__t.html#a104253e95536fa1af5f3d112f34b4088">dev_no</a>;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#aa9a2d5aaf853e3153e32a658212d8a80">   70</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___info__t.html#aa9a2d5aaf853e3153e32a658212d8a80">s_address</a>;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#a0e665976f83c349126f51601137da330">   71</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___info__t.html#a0e665976f83c349126f51601137da330">e_size</a>;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#a8b5d1cee52dce06629197fc8c5772a98">   72</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___info__t.html#a8b5d1cee52dce06629197fc8c5772a98">tc_address</a>;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#aaa3b172aa206f426c2da1e4914cea8c8">   73</a></span>&#160;    uint32_t <a class="code" href="structb_k_v___info__t.html#aaa3b172aa206f426c2da1e4914cea8c8">dc_address</a>;</div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#a5c4804c2a09afa64478d74905ca41c9f">   74</a></span>&#160;    uint32_t t_address[2];</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structb_k_v___info__t.html#a8ccdf017d97f099449e11d9a22007849">   75</a></span>&#160;    uint32_t d_address[2];</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}<a class="code" href="structb_k_v___info__t.html">bKV_Info_t</a>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#gad35428baad0145338fac35174a24cfd9">   86</a></span>&#160;<span class="preprocessor">#define bKV_IDLE        0</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#ga663b3efa83f9243ace5105a1c124319b">   87</a></span>&#160;<span class="preprocessor">#define bKV_BUSY        1</span></div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#ga7a4becc6356e8e8ff1cb311551d5c132">   88</a></span>&#160;<span class="preprocessor">#define bKV_ERROR       2</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#ga9b8339a656229abce501856a1acc4992">   91</a></span>&#160;<span class="preprocessor">#define bKV_SECTOR_T1   0X01</span></div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#gaf444d6a88d8d3a7f6a36f22e10defe4b">   92</a></span>&#160;<span class="preprocessor">#define bKV_SECTOR_T2   0X02 </span></div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#gaa67df877802f002bc2f3e7806415b0ee">   93</a></span>&#160;<span class="preprocessor">#define bKV_SECTOR_D1   0X04</span></div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#ga1dfd30143d7630349b1268ac41cda9e7">   94</a></span>&#160;<span class="preprocessor">#define bKV_SECTOR_D2   0X08 </span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="group___k_v___exported___defines.html#gaa90ff7ecee803e335df09c3cd4944e0d">   95</a></span>&#160;<span class="preprocessor">#define bKV_SECTOR_ALL  0X0F </span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___k_v___exported___functions.html#ga6bc0d26dee41f9b4c623ba06c4d85125">bKV_Init</a>(<span class="keywordtype">int</span> dev_no, uint32_t s_addr, uint32_t size, uint32_t e_size);</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___k_v___exported___functions.html#gaf484831f5c49d524f6bcdaf91dd3af4c">bKV_Set</a>(uint8_t *key, uint8_t *pvalue, uint16_t len);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___k_v___exported___functions.html#ga861289304680d05e55bccecd7d25d86d">bKV_Get</a>(uint8_t *key, uint8_t *pvalue);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___k_v___exported___functions.html#gacddcf86cd22518488e048afe3e31a9fa">bKV_Delete</a>(uint8_t *key);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    }</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;<span class="preprocessor">#endif  </span></div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;</div><div class="ttc" id="structb_k_v___index__t_html_ac0d31ca829f934cccd89f8054e02773e"><div class="ttname"><a href="structb_k_v___index__t.html#ac0d31ca829f934cccd89f8054e02773e">bKV_Index_t::address</a></div><div class="ttdeci">uint32_t address</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00059">b_kv.h:59</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_a104253e95536fa1af5f3d112f34b4088"><div class="ttname"><a href="structb_k_v___info__t.html#a104253e95536fa1af5f3d112f34b4088">bKV_Info_t::dev_no</a></div><div class="ttdeci">int dev_no</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00069">b_kv.h:69</a></div></div>
<div class="ttc" id="group___k_v___exported___functions_html_ga6bc0d26dee41f9b4c623ba06c4d85125"><div class="ttname"><a href="group___k_v___exported___functions.html#ga6bc0d26dee41f9b4c623ba06c4d85125">bKV_Init</a></div><div class="ttdeci">int bKV_Init(int dev_no, uint32_t s_addr, uint32_t size, uint32_t e_size)</div></div>
<div class="ttc" id="structb_k_v___info__t_html_aaa3b172aa206f426c2da1e4914cea8c8"><div class="ttname"><a href="structb_k_v___info__t.html#aaa3b172aa206f426c2da1e4914cea8c8">bKV_Info_t::dc_address</a></div><div class="ttdeci">uint32_t dc_address</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00073">b_kv.h:73</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_ade818037fd6c985038ff29656089758d"><div class="ttname"><a href="structb_k_v___info__t.html#ade818037fd6c985038ff29656089758d">bKV_Info_t::status</a></div><div class="ttdeci">uint8_t status</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00067">b_kv.h:67</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_aae5a12e607d0f782506d9e6ec6179c64"><div class="ttname"><a href="structb_k_v___info__t.html#aae5a12e607d0f782506d9e6ec6179c64">bKV_Info_t::index</a></div><div class="ttdeci">uint8_t index</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00068">b_kv.h:68</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_a8b5d1cee52dce06629197fc8c5772a98"><div class="ttname"><a href="structb_k_v___info__t.html#a8b5d1cee52dce06629197fc8c5772a98">bKV_Info_t::tc_address</a></div><div class="ttdeci">uint32_t tc_address</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00072">b_kv.h:72</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_a0e665976f83c349126f51601137da330"><div class="ttname"><a href="structb_k_v___info__t.html#a0e665976f83c349126f51601137da330">bKV_Info_t::e_size</a></div><div class="ttdeci">uint32_t e_size</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00071">b_kv.h:71</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html_aa9a2d5aaf853e3153e32a658212d8a80"><div class="ttname"><a href="structb_k_v___info__t.html#aa9a2d5aaf853e3153e32a658212d8a80">bKV_Info_t::s_address</a></div><div class="ttdeci">uint32_t s_address</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00070">b_kv.h:70</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="group___k_v___exported___functions_html_ga861289304680d05e55bccecd7d25d86d"><div class="ttname"><a href="group___k_v___exported___functions.html#ga861289304680d05e55bccecd7d25d86d">bKV_Get</a></div><div class="ttdeci">int bKV_Get(uint8_t *key, uint8_t *pvalue)</div></div>
<div class="ttc" id="group___k_v___exported___functions_html_gaf484831f5c49d524f6bcdaf91dd3af4c"><div class="ttname"><a href="group___k_v___exported___functions.html#gaf484831f5c49d524f6bcdaf91dd3af4c">bKV_Set</a></div><div class="ttdeci">int bKV_Set(uint8_t *key, uint8_t *pvalue, uint16_t len)</div></div>
<div class="ttc" id="structb_k_v___index__t_html_abaabdc509cdaba7df9f56c6c76f3ae19"><div class="ttname"><a href="structb_k_v___index__t.html#abaabdc509cdaba7df9f56c6c76f3ae19">bKV_Index_t::id</a></div><div class="ttdeci">uint32_t id</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00058">b_kv.h:58</a></div></div>
<div class="ttc" id="structb_k_v___index__t_html_a96bbf959016e4411c9e6b9812a8be60a"><div class="ttname"><a href="structb_k_v___index__t.html#a96bbf959016e4411c9e6b9812a8be60a">bKV_Index_t::len</a></div><div class="ttdeci">uint32_t len</div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00060">b_kv.h:60</a></div></div>
<div class="ttc" id="structb_k_v___info__t_html"><div class="ttname"><a href="structb_k_v___info__t.html">bKV_Info_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00065">b_kv.h:65</a></div></div>
<div class="ttc" id="group___k_v___exported___functions_html_gacddcf86cd22518488e048afe3e31a9fa"><div class="ttname"><a href="group___k_v___exported___functions.html#gacddcf86cd22518488e048afe3e31a9fa">bKV_Delete</a></div><div class="ttdeci">int bKV_Delete(uint8_t *key)</div></div>
<div class="ttc" id="structb_k_v___index__t_html"><div class="ttname"><a href="structb_k_v___index__t.html">bKV_Index_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__kv_8h_source.html#l00056">b_kv.h:56</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
